<%@ page import="support.*, java.util.*, java.sql.*, javax.sql.*" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> 
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<jsp:include page="header.jsp" />

	<div id="content" class="expand">
		<h2>Graduate Application</h2>
		
		<p>Entered Degrees:</p>
		
		<p>
		Degree 1 <br/>
		University: <bean:write name="DegreeForm" property="university" /> <br/>
		Major: <bean:write name="DegreeForm" property="discipline" /> <br/>
		Graduation: <bean:write name="DegreeForm" property="month" />/<bean:write name="DegreeForm" property="year" /> <br/>
		GPA: <bean:write name="DegreeForm" property="gpa" /> <br/>
		Title: <bean:write name="DegreeForm" property="title" /> <br/>
		</p>
		
		<%
		// This prints out the degrees that have been stored but not the one we were
		// just entering
		Vector degreeList = (Vector)request.getAttribute("degrees");
		for (int i = 0; i < degreeList.size(); i++) {
			out.print("<p>");
			out.print("Degree " + (i + 2) + " <br/>");
			HashMap currentDegree = (HashMap)degreeList.get(i);
			
			out.print("University: " + currentDegree.get("university") + " <br/>");
			out.print("Discipline: " + currentDegree.get("discipline") + " <br/>");
			out.print("Graduation: " + currentDegree.get("month") + "/" + currentDegree.get("year") + " <br/>");
			out.print("GPA: " + currentDegree.get("gpa") + " <br/>");
			out.print("Title: " + currentDegree.get("title") + " <br/>");
			
			out.print("</p>");
		}
		%>
			
		<p>Choose to add an additional degree or otherwise finish the application</p>

		<html:link action="students/additionalDegrees">
			<html:param name="additional" value="true" />
			<input type="submit" value="Submit Next Degree"/>
		</html:link> <br/>
		
		<html:link action="students/additionalDegrees">
			<html:param name="additional" value="false" />
			<input type="submit" value="Done"/>
		</html:link>
		
	</div>
	
</body>
</html>